/**
* Trigger Name: ifulfillRestrictDeleteWDefinition
* Author: Accenture 
* Date: 02-Feb-2012 
* Requirement/Project Name: iFulfill 
* Requirement Description: Workflow definition can be deleted when status is Inactive 
**/

trigger ifulfillRestrictDeleteWDefinition on Workflow_Definition__c (before delete)
{
list<Workflow_Definition__c> wdefinitionList = new list<Workflow_Definition__c>();
for(Workflow_Definition__c f: trigger.old) 
{  
  if(f.status__c =='Active' || f.status__c =='Pending Inactivation' || f.status__c=='Build In Progress')
  f.adderror('Workflow Definition cannot be deleted if status is not Inactive ');
  } 
}